<?xml version="1.0" encoding="UTF-8"?>
<wicket:extend>
			<!-- begin: #col1 - first float column -->
			<div id="col1" role="complementary">
				<div id="col1_content" class="clearfix">
				<form method="post" wicket:id="thisForm" action="" class="yform" role="application">
					<input type="hidden" wicket:id="selectedDateInput" />
					<div class="feedbackSpan" wicket:id="feedback"></div>
					<h3 style="display:inline;"><span wicket:id="selectedDate" class="importantTitle" /></h3>
					&nbsp;&nbsp;&nbsp;
					<span class="highlight" >当天已登记工时：<span id="hourSum" style="color:#600;font-weight:bold;">0</span> 小时</span>
					<table width="100%" wicket:id="projListPanel">
					<thead>
						<tr>
							<th width="5%" nowrap>序号</th>
							<th width="25%">工作项目</th>
							<th width="20%">占用工时</th>
							<th>工作记录及备注</th>
							<th width="5%" nowrap>删除</th>
						</tr>
					</thead>
					<tbody>
						<tr valign="top" wicket:id="projList">
							<td width="20" valign="middle">
							<div class="type-text" wicket:id="projectIdx" ></div>
							</td>
							<td width="40%">
							<div class="type-text">
								<a target="_blank" title="点击进入项目主页" style="font-weight:bold;" wicket:id="projectName"></a>
								<div style="margin-top:5px;"><span wicket:id="beginDate" />启动</div>
								<div wicket:id="milestone"></div>
								<div class="dimmed" wicket:id="dept"></div>
							</div>
							</td>
							<td width="20%">
							 <div class="type-text">
				                <input type="text" name="firstname" id="firstname" onkeyup="sumHour()" class="nothing" wicket:id="userHour" style="width:20px;display:inline;" /><span style="color:red;">*</span>
				                                       <br />小时
				                
				              </div>
								</td>
							<td>
							<div class="type-text">
				                <textarea name="message" id="message" wicket:id="hourMemo" style="width:300px;" rows="3"></textarea>
			              	</div>
							</td>
							<td nowrap>
							<div class="type-text" style="text-align:right;">
				     			<a href="javascript:void(0);" onclick="$($(this).next()).slideToggle('fast')">删除</a>
				     			<div class="important" style="display:none;">
								<a wicket:id="delLink">确定</a>&nbsp;
								<a href="javascript:void(0);" onclick="$($(this).parent()).slideToggle('fast')">取消</a>
								</div>
							</div>
			     			</td>
						</tr>
					</tbody>
					</table>
					<div class="type-button" style="margin:auto;">
		              <input type="submit" value="确定"  class="submit" id="submit" name="submit" />
		              <input type="reset" value="重置" class="reset" id="reset" name="reset" />
		            </div>
		        </form>
		        <form method="post" action="" class="yform" role="application">
		        <div class="type-text">
	     			<h5><span class="highlight">提示：请在右方选择登记日期和增加工作项目</span></h5>
	     		</div>
		        </form>
				</div>
			</div>
			<!-- end: #col1 -->
			<!-- begin: #col3 static column -->
			<div id="col3" role="main">
				<div id="col3_content" class="clearfix">
					<form method="post" action="" class="yform" role="application">
					<h5>选择登记日期：</h5>
					
					<div id="dataSelectArea"></div>
					</form>
					
					<form method="post" wicket:id="appendProjForm" action="" class="yform" role="application">
			        	<h5><span class="highlight" >双击增加工作项目：</span></h5>
			        	<div class="type-select" style="">
						  <select wicket:id="allprojs" title="双击增加工作项目" ondblclick="$('#appendProjButt').click();" style="margin:0 -15px;width:200px;font-size:14px;" size="20"></select>
			            </div>
			            <span style="display:none;">
			            <input type="button" value="增加项目" wicket:id="appendProjButt" />
			            </span>
			        </form>
					
					<form method="post" wicket:id="addProjForm" action="" class="yform" role="application">
						<div class="highlight" style="line-height:20px;">
						默认为所在大部门的项目，如果参与了其他部门/团队的工作，<br/>请<a style="color:#600;font-weight:bold;" href="javascript:void(0);" onclick="$('#otherProjSelectArea').slideToggle('fast')">在其他项目中登记工时</a>。	
						</div>
						<div id="otherProjSelectArea">
							<div class="type-select" style="margin:0 -10px;">
						      <span class="importantTitle">部门</span><select wicket:id="depts" style="width:140px;display:inline;"></select>
						    </div>
						    <div class="type-select" style="margin:0 -10px;">
							  <span class="importantTitle">项目</span><select wicket:id="projs" style="width:140px;display:inline;"></select>
				            </div>
						    <div class="type-button">
							  <input type="submit" value="增加项目" wicket:id="addProjButt" class="submit" id="submit" name="submit" />
				            </div>
						</div>
					</form>
				</div>
			</div>
			<div id="ie_clearing">&nbsp;</div>
			<!-- end: #col3 -->

<script type="text/javascript">
$(document).ready(function(){
	WdatePicker({
		eCont:'dataSelectArea',
		specialDates:[$('#selectedDateInput').val()],
		onpicked:function(dp){
			location.href = "/"+getContextPath() + "/app/main/?d=" +dp.cal.getDateStr();
		}
	});
	sumHour();
	$('#otherProjSelectArea').hide();

	var opts = $('#allprojs option');
	for(var i = 0; i < opts.length; i++) {
		if($(opts[i]).val().indexOf('dept_') == 0) {
			$(opts[i]).css("color","#606060");
			$(opts[i]).css("background-color","#F4F4F4");
			$(opts[i]).attr("disabled","true");
		}
		else if($(opts[i]).val() == "") {
			$(opts[i]).css("background-color","#F4F4F4");
			$(opts[i]).attr("disabled","true");
		}
		else {
			$(opts[i]).css("background-color","#F9F8DD");
		}
	}
	
});
function sumHour() {
	var totalHour = 0.0;
	for(var i = 0; i < $('.nothing').length; i++) {
		totalHour += parseFloat($($('.nothing')[i]).val(), 10);
	}
	$('#hourSum').html(totalHour);
}
</script>

</wicket:extend>